package com.financing.platform.service.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFpFileRecordDao;
import com.financing.platform.dto.FpFileRecordDTO;
import com.financing.platform.service.IFpFileRecordService;
/**
 * fp_file_record  
 * 文件记录表 业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpFileRecordService")
public class FpFileRecordServiceImpl implements IFpFileRecordService{

	@Autowired
	private IFpFileRecordDao fpFileRecordDao;

	@Override
	public int insert(FpFileRecordDTO fpFileRecord) throws SQLException {
		return fpFileRecordDao.insert(fpFileRecord);
	}

	@Override
	public void update(FpFileRecordDTO fpFileRecord) throws SQLException {
		fpFileRecordDao.update(fpFileRecord);
	}

	@Override
	public void updateForce(FpFileRecordDTO fpFileRecord) throws SQLException {
		fpFileRecordDao.updateForce(fpFileRecord);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		fpFileRecordDao.delete(id);
	}
	
	@Override
	public List<FpFileRecordDTO> queryList(FpFileRecordDTO fpFileRecord) throws SQLException {
		return fpFileRecordDao.queryList(fpFileRecord);
	}

	@Override
	public int queryListCount(FpFileRecordDTO fpFileRecord) throws SQLException {
		return fpFileRecordDao.queryListCount(fpFileRecord);
	}

	@Override
	public FpFileRecordDTO loadById(Integer id) throws SQLException {
		return fpFileRecordDao.loadById(id);
	}
 	@Override
	public FpFileRecordDTO queryListGetFirst(FpFileRecordDTO fpFileRecord)
			throws SQLException {
		 List<FpFileRecordDTO> queryList = queryList(fpFileRecord);
		 if(queryList==null||queryList.size()==0){
			 return new FpFileRecordDTO();
		 }
		 return queryList.get(0);
	}
}
